home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / calc_dipshit.c < prev    next >
Text File  |  1996-06-22  |  17KB  |  697 lines

  1.  
  2.  
  3.             /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
  4.             /*                                                               */
  5.             /*                    Prototype HP15C Calculator                */
  6.             /*                    James C. Ullrey                            */
  7.             /*                    INRESCO                                    */
  8.             /*                    © 1990                                    */
  9.             /*                    Version    13.97a                            */
  10.             /*                                                               */
  11.             /*                    DIP_SHIT SEGMENT                           */
  12.             /*                                                               */
  13.             /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
  14.  
  15.  
  16.  
  17. /*****************************************************************/
  18. /*  I N C L U D E S                                                 */
  19. /*****************************************************************/
  20.  
  21.  
  22. #ifndef __C14__
  23. #include    "PredatorPrey.h"
  24. #endif
  25. #include     "Globals.h"
  26. #ifndef __RED__
  27. #include     "ResourceDefs.h"
  28. #endif
  29. #include     "calc_dipshit.h"
  30. #include     <Sound.h>
  31. #include    "DialogAids.h"
  32.  
  33. #define        DoneButton        1
  34. #define     Field3            3 
  35. #define     Field4            4 
  36. #define     Field5            5 
  37.  
  38.  
  39. /********************************************************************
  40. /*  G L O B A L   V A R I A B L E   D E C L A R A T I O N S
  41. /********************************************************************/
  42.  
  43. extern        Boolean            stillWizard;
  44. extern        Boolean            WizAttempt;
  45. extern        Boolean            PassAttempt;
  46. extern        Boolean            gIsWizard;
  47. extern        Boolean            gLoadProgEnabled;
  48. extern        Str255            bufferOne;
  49. extern        Str255            bufferTwo;
  50. extern        Str255            bufferTwe;
  51. extern        long            gTime;
  52.             const            short    kRevealedText    =    4;
  53.             const            short    kGoAway            =    18;
  54. static        const            char    kEnter            =    (char) 0x03;
  55. static        const            char    kReturn            =    (char) 0x0D;
  56. static        const            char    kSpace            =    ' ';
  57. static        const            char    kPeriod            =    '.';
  58. static        const            char    kBullet            =    '•';
  59.             TEHandle        pMirrorEditText            =    nil;
  60.             TEHandle        ppMirrorEditText        =    nil;
  61.  
  62. /*****************************************************************/
  63. /*  P R O T O T Y P E S
  64. /*****************************************************************/
  65.  
  66.  
  67.         Boolean    GetWiz            (    WizRec    *Wiz);
  68.         Boolean    GetPass1        (    PassRec    *Pass);
  69.         Boolean    GetPass2        (    PassRec    *Pass);
  70. //extern    void     SetDText        (    short        itemNr,
  71. //                                     Str255        text
  72. //                                 );        
  73.         void     GetDText        (    short        itemNr,
  74.                                      Str255        text
  75.                                  );
  76. extern    void    OutlineButton    (short        itemHit);
  77. //extern    pascal     Boolean         StandardFilter    (    DialogPtr    whichDialog,
  78. //                                                     EventRecord    *event,
  79. //                                                     short        *itemHit
  80. //                                                 );
  81.         pascal    Boolean         PasswordProc1    (    DialogPtr    theDialog,
  82.                                                     EventRecord    *theEvent,
  83.                                                     short    *itemHit);
  84.         pascal    Boolean         PasswordProc2    (    DialogPtr    theDialog,
  85.                                                     EventRecord    *theEvent,
  86.                                                     short    *itemHit);
  87. /*        void    DoThePreReg        (void);*/
  88. /*        Boolean    GetPreReg        (PreRegRec    *Reg);*/
  89. /*****************************************************************/
  90. /*****************************************************************/
  91. /*
  92. /* R O U T I N E S
  93. /*
  94. /*****************************************************************/
  95. /*****************************************************************/
  96.  
  97.  
  98. void    dipshit_seg() {}        /*  for reference in "UnloadSeg()" calls    */
  99.  
  100. /*****************************************************************/
  101. /********************** DumbShit *********************************/
  102. /*****************************************************************/
  103. void    DumbShit(short selector)
  104. {
  105.     Str255    key2;
  106.     short    i,j,k;
  107.  
  108.     key2[0] = 28;
  109.     key2[1] = 't';
  110.     key2[2] = 'h';
  111.     key2[3] = 'e';
  112.     key2[4] = 'k';
  113.     key2[5] = 'e';
  114.     key2[6] = 'y';
  115.     key2[7] = 't';
  116.     key2[8] = 'o';
  117.     key2[9] = 'r';
  118.     key2[10] = 'e';
  119.     key2[11] = 'b';
  120.     key2[12] = 'e';
  121.     key2[13] = 'c';
  122.     key2[14] = 'c';
  123.     key2[15] = 'a';
  124.     key2[16] = 'c';
  125.     key2[17] = 'r';
  126.     key2[18] = 'y';
  127.     key2[19] = 'p';
  128.     key2[20] = 't';
  129.     key2[21] = 'o';
  130.     key2[22] = 'g';
  131.     key2[23] = 'r';
  132.     key2[24] = 'a';
  133.     key2[25] = 'p';
  134.     key2[26] = 'h';
  135.     key2[27] = 'i';
  136.     key2[28] = 'c';
  137.     
  138.     switch(selector)
  139.     {
  140.         case 1:
  141.             j = map.SUPassword[0];
  142.             for(i = 1;i <= 28;i++)
  143.             {
  144.                 map.mem4name[i] = (char)map.SUPassword[i%j] ^ (char)key2[i];
  145.             }
  146.             map.mem4name[0] = 28;
  147.             gIsWizard = TRUE;
  148.             stillWizard = TRUE;
  149.             for(i = 0;i <= 28;i++)
  150.             {
  151.                 if(map.mem4name[i] == map.mem3name[i])
  152.                 {
  153.                     ;    /* do nothing */
  154.                 }
  155.                 else
  156.                 {
  157.                     gIsWizard = FALSE;
  158.                     stillWizard = FALSE;
  159.                 }
  160.             }
  161.             break;
  162.         case 2:
  163.             j = map.mem2name[0];
  164.             for(i = 1;i <= 28;i++)
  165.             {
  166.                 map.mem4name[i] = (char)map.mem2name[i%j] ^ (char)key2[i];
  167.             }
  168.             for(i = 0;i <= 28;i++)
  169.             {
  170.                 map.mem3name[i] = map.mem4name[i];
  171.             }
  172.             break;
  173.     }
  174. }
  175.  
  176.  
  177. /*****************************************************************/
  178. /************************ DoWiz **********************************/
  179. /*****************************************************************/
  180. static void    DoWiz(void)
  181. {
  182.     WizRec        WizInfo;
  183.     register    WizRecPtr info;
  184.     short        i,j;
  185.     /*short        FanfareID;*/
  186.     Handle        sound;
  187.     OSErr        errCode;
  188.     
  189.     info = &WizInfo;
  190.     info->Field3Text [0] = 0;
  191.     info->Field5Text [0] = 0;
  192.     
  193.     if(GetWiz(&WizInfo))
  194.     {
  195.         /* use WizInfo */
  196.         if(info->Field3Text [0] != 0)
  197.         {
  198.             i = info->Field3Text [0];
  199.             for(j = 0;j<=i;j++)
  200.             {
  201.                 map.SUName[j] = info->Field3Text[j];
  202.                 /*map.mem2name[j] = info->Field3Text[j];*/
  203.             }
  204.         }
  205.         if(info->Field5Text [0] != 0)
  206.         {
  207.             WizAttempt = TRUE;
  208.             /*Delay(1,&startTick1);*/
  209.             i = info->Field5Text [0];
  210.             for(j = 0;j<=i;j++)
  211.             {
  212.                 map.SUPassword[j] = info->Field5Text[j];
  213.                 /*map.mem3name[j] = info->Field5Text[j];*/
  214.             }
  215.         }
  216.         DumbShit(1);
  217.         if(gIsWizard)
  218.         {
  219.             sound = GetResource ('snd ', FanfareID);
  220.             if (sound != NULL)
  221.             {
  222. /* cw5 */        //errCode = SndPlay (NULL, sound, false);
  223.             }
  224.             DelMenuItem( GetMHandle(FILE_MENU_ID), 6 );
  225.             InsMenuItem( GetMHandle(FILE_MENU_ID), "\pOpen Program/L", 5 );
  226.             DelMenuItem( GetMHandle(FILE_MENU_ID), 7 );
  227.             InsMenuItem( GetMHandle(FILE_MENU_ID), "\pOpen Data", 6 );
  228.             if(!gLoadProgEnabled)
  229.             {
  230.                 DisableItem(GetMHandle(FILE_MENU_ID), 6);    /* LOAD_PROGRAM  */
  231.                 DisableItem(GetMHandle(FILE_MENU_ID), 7);    /* IS NOW OPEN PROGRAM */
  232.             }
  233.             WizardMenu    = GetMenu (WizardMenuID);                                                
  234.             InsertMenu (WizardMenu, 0);
  235.             DrawMenuBar();                                                
  236.         }
  237.         else
  238.         {
  239.             sound = GetResource ('snd ', BronxID);
  240.             if (sound != NULL)
  241.             {
  242. /* cw5 */        //errCode = SndPlay (NULL, sound, false);
  243.             }        
  244.         }
  245.     }
  246. }
  247.  
  248. /*****************************************************************/
  249. /********************** DoTheWiz *********************************/
  250. /*****************************************************************/
  251. void    DoTheWiz(void)
  252. {
  253.     DoWiz();
  254. }
  255.  
  256.  
  257. /*****************************************************************/
  258. /*********************** GetWiz **********************************/
  259. /*****************************************************************/
  260. Boolean    GetWiz(WizRec    *Wiz)
  261. {
  262.     GrafPtr            wOldPort;
  263.     DialogPtr        wizPtr;
  264.     Boolean            result = TRUE;
  265.     Boolean            done;
  266.     short            itemHit;
  267.     register         WizRecPtr    info;
  268.     ModalFilterUPP    gMyStandardFilterUPP;
  269.  
  270.     if((wizPtr = GetNewDialog(WIZ_SCRN,NIL_PTR,(WindowPtr)MOVE_TO_FRONT) ) != NIL_PTR )
  271.     {
  272.         GetPort(&wOldPort );
  273.         /*CenterWindow( wizPtr );*/
  274.         ShowHide( wizPtr,TRUE );                        /* Make window visible if invisible */
  275.         SetPort( wizPtr );
  276.         info = Wiz;
  277.         SetDText (Field3, info->Field3Text);                                            
  278.         SetDText (Field5, info->Field5Text);
  279.         DrawDialog(wizPtr);
  280.         OutlineButton (1);
  281.         done = false;
  282.         gMyStandardFilterUPP = NewModalFilterProc(StandardFilter);
  283.         while (!done)
  284.         {
  285.             //ModalDialog((ProcPtr)StandardFilter,&itemHit);
  286.             ModalDialog(gMyStandardFilterUPP,&itemHit);
  287.             switch(itemHit)
  288.             {
  289.                 case DoneButton:
  290.                     done = true;
  291.                     break;
  292.                 case Field3:
  293.                     GetDText (itemHit, info->Field3Text);
  294.                     break;
  295.                 case Field5:
  296.                     GetDText (itemHit, info->Field5Text);
  297.                     break;
  298.             }
  299.         }
  300.         /*gIsWizard = TRUE;*/
  301.         DisposDialog (wizPtr);                        /* Remove window from memory */
  302.         SetPort( wOldPort );
  303.         return (result);    
  304.     }
  305. }
  306.  
  307. /*****************************************************************/
  308. /******************* PasswordProc1 *******************************/
  309. /*****************************************************************/
  310. pascal    Boolean PasswordProc1(    DialogPtr    theDialog,
  311.                                 EventRecord    *theEvent,
  312.                                 short    *itemHit)
  313. {
  314.     Boolean        result;
  315.     char        key;        // key pressed by the user
  316.     Rect        dummyRect;    // Scratch rectangle for creating TERecord
  317.     TEHandle    dialogTE;
  318.     Str255        password;
  319.     short        iKind;
  320.     Handle        iHandle;
  321.     Rect        iRect;
  322.     
  323.     result = FALSE;
  324.     
  325.     if(pMirrorEditText == nil)
  326.     {
  327.         SetRect(&dummyRect, 0, 0, 0, 0);
  328.         pMirrorEditText = TENew(&dummyRect, &dummyRect);
  329.     }
  330.     if ((theEvent->what == keyDown) || (theEvent->what == autoKey))
  331.     {
  332.         key = theEvent->message & charCodeMask;
  333.         if (( key == kReturn) || (key == kEnter))
  334.         {
  335.             if (pMirrorEditText != nil)
  336.             {
  337.                 TEDispose(pMirrorEditText);
  338.                 pMirrorEditText = nil;
  339.             }
  340.             *itemHit = kGoAway;
  341.             result = TRUE;
  342.         }
  343.         else
  344.         {
  345.             if (key >= ' ')
  346.             {
  347.                 theEvent->message &= ~charCodeMask;
  348.                 theEvent->message |= '*';        
  349.             }
  350.             dialogTE = ( (DialogPeek)theDialog)->textH;
  351.             (*pMirrorEditText)->selStart = (*dialogTE)->selStart;
  352.             (*pMirrorEditText)->selEnd = (*dialogTE)->selEnd;
  353.             TEKey(key, pMirrorEditText);
  354.             password[0] = (*pMirrorEditText)->teLength;
  355.             BlockMove(*((*pMirrorEditText)->hText),&password[1],password[0]);
  356.             GetDItem(theDialog, kRevealedText, &iKind,&iHandle, &iRect);
  357.             SetIText(iHandle,password);
  358.         }
  359.     }
  360.     return result;
  361. }
  362.  
  363. /*****************************************************************/
  364. /******************* PasswordProc2 *******************************/
  365. /*****************************************************************/
  366. pascal    Boolean PasswordProc2(    DialogPtr    theDialog,
  367.                                 EventRecord    *theEvent,
  368.                                 short    *itemHit)
  369. {
  370.     Boolean        result;
  371.     char        key;        // key pressed by the user
  372.     Rect        dummyRect;    // Scratch rectangle for creating TERecord
  373.     TEHandle    dialogTE;
  374.     Str255        password;
  375.     short        iKind;
  376.     Handle        iHandle;
  377.     Rect        iRect;
  378.     
  379.     result = FALSE;
  380.     
  381.     if(ppMirrorEditText == nil)
  382.     {
  383.         SetRect(&dummyRect, 0, 0, 0, 0);
  384.         ppMirrorEditText = TENew(&dummyRect, &dummyRect);
  385.     }
  386.     if ((theEvent->what == keyDown) || (theEvent->what == autoKey))
  387.     {
  388.         key = theEvent->message & charCodeMask;
  389.         if (( key == kReturn) || (key == kEnter))
  390.         {
  391.             if (ppMirrorEditText != nil)
  392.             {
  393.                 TEDispose(ppMirrorEditText);
  394.                 ppMirrorEditText = nil;
  395.             }
  396.             *itemHit = kGoAway;
  397.             result = TRUE;
  398.         }
  399.         else                                                /*    PasswordProc2    */
  400.         {
  401.             if (key >= ' ')
  402.             {
  403.                 theEvent->message &= ~charCodeMask;
  404.                 theEvent->message |= '*';        
  405.             }
  406.             dialogTE = ( (DialogPeek)theDialog)->textH;
  407.             (*ppMirrorEditText)->selStart = (*dialogTE)->selStart;
  408.             (*ppMirrorEditText)->selEnd = (*dialogTE)->selEnd;
  409.             TEKey(key, ppMirrorEditText);
  410.             password[0] = (*ppMirrorEditText)->teLength;
  411.             BlockMove(*((*ppMirrorEditText)->hText),&password[1],password[0]);
  412.             GetDItem(theDialog, kRevealedText, &iKind,&iHandle, &iRect);
  413.             SetIText(iHandle,password);
  414.         }
  415.     }
  416.     return result;
  417. }
  418.  
  419.  
  420. /*****************************************************************/
  421. /********************** GetPass1 *********************************/
  422. /*****************************************************************/
  423. Boolean    GetPass1(PassRec    *Pass)
  424. {
  425.     GrafPtr            wOldPort;
  426.     DialogPtr        passPtr;
  427.     Boolean            result = TRUE;
  428.     Boolean            done;
  429.     short            itemHit;
  430.     register         PassRecPtr    info;
  431.     ModalFilterUPP    gMyPasswordProcUPP;
  432.  
  433.  
  434.     if((passPtr = GetNewDialog(PASS_SCRN,NIL_PTR,(WindowPtr)MOVE_TO_FRONT) ) != NIL_PTR )
  435.     {
  436.         GetPort(&wOldPort );
  437.         /*CenterWindow( wizPtr );*/
  438.         ShowHide( passPtr,TRUE );                        /* Make window visible if invisible */
  439.         SetPort( passPtr );
  440.         info = Pass;
  441.         SetDText (Field3, info->Field3Text);                                            
  442.         SetDText (Field4, info->Field4Text);                                            
  443.         /*SetDText (Field5, info->Field5Text);*/
  444.         DrawDialog(passPtr);
  445.         OutlineButton (1);
  446.         done = false;
  447.         gMyPasswordProcUPP = NewModalFilterProc(PasswordProc1);        
  448.         while (!done)
  449.         {
  450.             //ModalDialog(PasswordProc1,&itemHit);        /* Password screen 1 */
  451.             ModalDialog(gMyPasswordProcUPP,&itemHit);        /* Password screen 1 */
  452.             switch(itemHit)
  453.             {
  454.                 case DoneButton:
  455.                     done = true;
  456.                     break;
  457.                 case Field3:
  458.                     GetDText (itemHit, info->Field3Text);
  459.                     GetDText ( 4, info->Field4Text);
  460.                     break;
  461.             }
  462.         }
  463.         /*gIsWizard = TRUE;*/
  464.         DisposDialog (passPtr);                        /* Remove window from memory */
  465.         SetPort( wOldPort );
  466.         /*TEDispose( pMirrorEditText );*/
  467.         return (result);    
  468.     }
  469. }
  470.  
  471. /*****************************************************************/
  472. /********************** GetPass2 *********************************/
  473. /*****************************************************************/
  474. Boolean    GetPass2(PassRec    *Pass)
  475. {
  476.     GrafPtr            wOldPort;
  477.     DialogPtr        passPtr;
  478.     Boolean            result = TRUE;
  479.     Boolean            done;
  480.     short            itemHit;
  481.     register         PassRecPtr    info;
  482.     ModalFilterUPP    gMyPasswordProcUPP;
  483.  
  484.     if((passPtr = GetNewDialog(PASS_SCRN2,NIL_PTR,(WindowPtr)MOVE_TO_FRONT) ) != NIL_PTR )
  485.     {
  486.         GetPort(&wOldPort );
  487.         /*CenterWindow( wizPtr );*/
  488.         ShowHide( passPtr,TRUE );                        /* Make window visible if invisible */
  489.         SetPort( passPtr );
  490.         info = Pass;
  491.         SetDText (Field3, info->Field3Text);                                            
  492.         SetDText (Field4, info->Field4Text);                                            
  493.         SetDText (Field5, info->Field5Text);
  494.         DrawDialog(passPtr);
  495.         OutlineButton (1);
  496.         done = false;
  497.         gMyPasswordProcUPP = NewModalFilterProc(PasswordProc2);
  498.         while (!done)
  499.         {
  500.             //ModalDialog(PasswordProc2,&itemHit);        /* Password screen 2 */
  501.             ModalDialog(gMyPasswordProcUPP,&itemHit);        /* Password screen 2 */
  502.             switch(itemHit)
  503.             {
  504.                 case DoneButton:
  505.                     done = true;
  506.                     break;
  507.                 case Field3:
  508.                     GetDText (itemHit, info->Field3Text);
  509.                     GetDText ( 4, info->Field5Text);
  510.                     break;
  511.             }
  512.         }
  513.         /*gIsWizard = TRUE;*/
  514.         DisposDialog (passPtr);                        /* Remove window from memory */
  515.         SetPort( wOldPort );
  516.         /*TEDispose( pMirrorEditText );*/
  517.         return (result);    
  518.     }
  519. }
  520.  
  521. /*****************************************************************/
  522. /********************* DoPassword ********************************/
  523. /*****************************************************************/
  524. static void    DoPassword(void)
  525. {
  526.     PassRec        PassInfo;
  527.     register    PassRecPtr info;
  528.     short        i,j;
  529.     Boolean        match;
  530.     Handle        sound;
  531.     OSErr        errCode;
  532.     
  533.     info = &PassInfo;
  534.     info->Field3Text [0] = 0;    
  535.     info->Field4Text [0] = 0;
  536.     info->Field5Text [0] = 0;
  537.     
  538.     if(GetPass1(&PassInfo))
  539.     {
  540.         /* use WizInfo */
  541.         if(info->Field4Text [0] != 0)
  542.         {
  543.             PassAttempt = TRUE;
  544.             i = info->Field4Text [0];
  545.             for(j = 0;j<=i;j++)
  546.             {
  547.                 map.mem2name[j] = info->Field4Text[j];
  548.             }
  549.         }
  550.     }
  551.     info->Field3Text [0] = 0;
  552.     info->Field4Text [0] = 0;
  553.     if(GetPass2(&PassInfo))
  554.     {
  555.         /* use WizInfo */
  556.         if(info->Field5Text [0] != 0)
  557.         {
  558.             PassAttempt = TRUE;
  559.             i = info->Field5Text [0];
  560.             for(j = 0;j<=i;j++)
  561.             {
  562.                 map.mem5name[j] = info->Field5Text[j];
  563.             }
  564.         }
  565.     }
  566.     if((j = map.mem2name[0]) == map.mem5name[0])
  567.     {
  568.         match = TRUE;
  569.         for(i = 1; i <= j;i++)
  570.         {
  571.             if(map.mem2name[i] == map.mem5name[i])
  572.             {
  573.                 ; /* do nothing */
  574.             }
  575.             else
  576.             {
  577.                 match = FALSE;
  578.             }
  579.         }
  580.         if(match)
  581.         {
  582.             sound = GetResource ('snd ', FanfareID);
  583.             if (sound != NULL)
  584.             {
  585. /* cw5 */        //errCode = SndPlay (NULL, sound, false);
  586.             }
  587.             DumbShit(2);
  588.         }
  589.         else
  590.         {
  591.             sound = GetResource ('snd ', BronxID);
  592.             if (sound != NULL)
  593.             {
  594. /* cw5 */        //errCode = SndPlay (NULL, sound, false);
  595.             }
  596.         }            
  597.     }
  598. }
  599.  
  600. /*****************************************************************/
  601. /******************** DoSetPassword ******************************/
  602. /*****************************************************************/
  603. void    DoSetPassword(void)
  604. {
  605.     DoPassword();
  606. }
  607.  
  608. /*****************************************************************/
  609. /******************** DoShareCopy ********************************/
  610. /*****************************************************************/
  611. void    DoShareCopy    ()
  612. {
  613.     short    i,j;
  614.     
  615.     if(bufferOne [0] != 0)
  616.     {
  617.         i = bufferOne [0];
  618.         for(j = 0;j<=i;j++)
  619.         {
  620.             map.ownerName[j] = bufferOne[j];
  621.         }
  622.     }
  623.     if(bufferTwo [0] != 0)
  624.     {
  625.         i = bufferTwo [0];
  626.         for(j = 0;j<=i;j++)
  627.         {
  628.             map.ownerOrg[j] = bufferTwo[j];
  629.         }
  630.     }
  631.     if(bufferTwe [0] != 0)
  632.     {
  633.         i = bufferTwe [0];
  634.         for(j = 0;j<=i;j++)
  635.         {
  636.             map.ownerRegNo[j] = bufferTwe[j];
  637.         }
  638.     }
  639. }
  640.  
  641. /*****************************************************************/
  642. /*********************** DipShit *********************************/
  643. /*****************************************************************/        
  644. void    DipShit()
  645. {
  646.     Str255    key;
  647.     short    i,j,k;
  648.     long    theNum;
  649.  
  650.     j = map.ownerName[0];
  651.     if(j == 0) j = 1;
  652.     k = map.ownerOrg[0];
  653.     if(k == 0) k = 1;
  654.         
  655.     key[0] = 28;
  656.     key[1] = 'a';
  657.     key[2] = 'n';
  658.     key[3] = 't';
  659.     key[4] = 'i';
  660.     key[5] = 'd';
  661.     key[6] = 'i';
  662.     key[7] = 's';
  663.     key[8] = 'e';
  664.     key[9] = 's';
  665.     key[10] = 't';
  666.     key[11] = 'a';
  667.     key[12] = 'b';
  668.     key[13] = 'l';
  669.     key[14] = 'i';
  670.     key[15] = 's';
  671.     key[16] = 'h';
  672.     key[17] = 'm';
  673.     key[18] = 'e';
  674.     key[19] = 'n';
  675.     key[20] = 't';
  676.     key[21] = 'a';
  677.     key[22] = 'r';
  678.     key[23] = 'i';
  679.     key[24] = 'a';
  680.     key[25] = 'n';
  681.     key[26] = 'i';
  682.     key[27] = 's';
  683.     key[28] = 'm';
  684.  
  685.     Delay(1,&gTime);
  686.     for(i = 1;i <= 28;i++)
  687.     {
  688.         map.mem1name[i] = (char)map.ownerName[i%j] ^ (char)key[i];
  689.     }
  690.     for(i = 1;i <= 28;i++)
  691.     {
  692.         map.mem1name[i] ^= map.ownerOrg[i%k];
  693.     }
  694.     map.mem1name[0] = 28;
  695. }
  696.  
  697.